<template>
  <div id="app" style="font-size: 14px">
    <!--页面-->
    <keep-alive>
      <router-view v-if="isActiveAlive && $route.meta.keepAlive"/>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive"></router-view>
    <!--底部tab栏组件-->
    <Tabbar/>
  </div>
</template>
<script type="es6">
export default {
  provide() {
    return {reload: this.reload};
  },
  components: {},
  data() {
    return {
      isActiveAlive: true
    }
  },
  mounted() {
    console.log(process.env);
  },
  methods: {
    /**刷新当前页面*/
    reload(callback) {
      this.isActiveAlive = false;
      this.$nextTick(() => {
        this.isActiveAlive = true;
        window.scrollTo(0, 0);
        if (typeof callback == "function") {
          callback();
        }
      })
    },
  }
}
</script>
<style lang="scss">
@import "./assets/css/reset";
@import "./assets/css/vant@2.10.0.css";
@import "./assets/css/ok-common";
@import "./assets/css/app";

body {
  max-width: 375px;
  margin: 0 auto;
  background: #F5F4F9;
  color: #333333;
  font-size: 14px;
}
.page{
  font-size: 14px;
}
</style>
